namespace JQuery.WebKit
{
    using System.ComponentModel;
    using System.Security.Permissions;
    using System.Web;

    [AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal), AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
    public class WebGridSearchEventArgs : CancelEventArgs
    {
        public GroupOperation GroupOperation { get; private set; }
        public SearchCriteriaCollection CriteriaList { get; private set; }

        public WebGridSearchEventArgs(string groupOp)
        {
            CriteriaList = new SearchCriteriaCollection();
            switch (groupOp.Trim().ToLower())
            {
                case "and":
                    GroupOperation = GroupOperation.And;
                    break;
                case "or":
                    GroupOperation = GroupOperation.Or;
                    break;
                default:
                    break;
            }
        }

        public WebGridSearchEventArgs()
            : this(string.Empty)
        {

        }
    }
}

